
#ifndef ICONVERTIBLE_H
#define ICONVERTIBLE_H

// Riccsson includes.
#include <Typedef.h>
#include <Defines.h>

#include <System/TypeCode.h>
#include <System/Decimal.h>

// using System.Runtime.InteropServices;

namespace Riccsson
{
	namespace System
	{
		class Object;
		class Type;
		class IFormatProvider;
		struct DateTime;
		class String;

		// Summary:
		//     Defines methods that convert the value of the implementing reference or value
		//     type to a common language runtime type that has an equivalent value.
		//[CLSCompliant(false)]
		//[ComVisible(true)]
		interface IConvertible
		{
			// Summary:
			//     Returns the System.TypeCode for this instance.
			//
			// Returns:
			//     The enumerated constant that is the System.TypeCode of the class or value
			//     type that implements this interface.
			virtual TypeCode GetTypeCode() = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent Boolean value using
			//     the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     A Boolean value equivalent to the value of this instance.
			virtual bool ToBoolean(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent 8-bit unsigned integer
			//     using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     An 8-bit unsigned integer equivalent to the value of this instance.
			virtual byte ToByte(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent Unicode character using
			//     the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     A Unicode character equivalent to the value of this instance.
			virtual char ToChar(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent System.DateTime using
			//     the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     A System.DateTime instance equivalent to the value of this instance.
			virtual DateTime ToDateTime(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent System.Decimal number
			//     using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     A System.Decimal number equivalent to the value of this instance.
			virtual Decimal ToDecimal(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent double-precision floating-point
			//     number using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     A double-precision floating-point number equivalent to the value of this
			//     instance.
			virtual double ToDouble(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent 16-bit signed integer
			//     using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     An 16-bit signed integer equivalent to the value of this instance.
			virtual short ToInt16(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent 32-bit signed integer
			//     using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     An 32-bit signed integer equivalent to the value of this instance.
			virtual int ToInt32(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent 64-bit signed integer
			//     using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     An 64-bit signed integer equivalent to the value of this instance.
			virtual long long ToInt64(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent 8-bit signed integer
			//     using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     An 8-bit signed integer equivalent to the value of this instance.
			virtual sbyte ToSByte(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent single-precision floating-point
			//     number using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     A single-precision floating-point number equivalent to the value of this
			//     instance.
			virtual float ToSingle(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent System.String using
			//     the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     A System.String instance equivalent to the value of this instance.
			virtual GC_PTR<String> ToString(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an System.Object of the specified
			//     System.Type that has an equivalent value, using the specified culture-specific
			//     formatting information.
			//
			// Parameters:
			//   conversionType:
			//     The System.Type to which the value of this instance is converted.
			//
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     An System.Object instance of type conversionType whose value is equivalent
			//     to the value of this instance.
			virtual GC_PTR<Object> ToType(Type* conversionType, IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent 16-bit unsigned integer
			//     using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     An 16-bit unsigned integer equivalent to the value of this instance.
			virtual ushort ToUInt16(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent 32-bit unsigned integer
			//     using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     An 32-bit unsigned integer equivalent to the value of this instance.
			virtual uint ToUInt32(IFormatProvider* provider) = 0;
			//
			// Summary:
			//     Converts the value of this instance to an equivalent 64-bit unsigned integer
			//     using the specified culture-specific formatting information.
			//
			// Parameters:
			//   provider:
			//     An System.IFormatProvider interface implementation that supplies culture-specific
			//     formatting information.
			//
			// Returns:
			//     An 64-bit unsigned integer equivalent to the value of this instance.
			virtual ulong ToUInt64(IFormatProvider* provider) = 0;
		};
	}
}

#endif // ICONVERTIBLE_H